home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / demos / GL / flip / light.h < prev    next >
C/C++ Source or Header  |  1994-08-01  |  2KB  |  68 lines

  1. /*
  2.  * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /* lighting and material stuff */
  18.  
  19. /* Use defineshading() before trying to use other routines */
  20. void defineshading(void) ;
  21.  
  22. /*
  23.  * setmaterial expects a value in the range of 0...NUM_MATERIALS, and
  24.  * will make that material the current material.  Materials
  25.  * NUM_MATERIALS...NUM_MATERIALS*2 are defined to be transparent
  26.  * versions of the materials on machines that can do alpha-blending.
  27.  * Materials are defined at the end of light.c
  28.  */
  29. #define NUM_MATERIALS 10
  30. void setmaterial(int);
  31. extern char *matnames[NUM_MATERIALS];
  32.  
  33. /*
  34.  *    switch_light will toggle the given light (rand 0..NUM_LIGHTS) on
  35.  * and off.
  36.  */
  37. #define NUM_LIGHTS 8
  38. void switch_light(int) ;
  39. extern char *lightnames[NUM_LIGHTS];
  40.  
  41. /*
  42.  *    rebind_lights will rebind all the lights that are turned on,
  43.  * causing them to change position if the viewing matrix has changed.
  44.  */
  45. void rebind_lights(void);
  46.  
  47. /*
  48.  *    draw_lights will draw a representation of each of the lights that
  49.  * is turned on; local lights are represented by small spheres
  50.  * (icosahedron, really) and infinite lights are arrows pointing in
  51.  * the direction they are shining.  It returns the number of polygons
  52.  * required to draw the lights.
  53.  */
  54. int draw_lights(void);
  55.  
  56. /*
  57.  *    setmodel will set the lighting model (range 0..NUM_LMODELS)
  58.  */
  59. #define NUM_LMODELS 2
  60. void setmodel(int);
  61. extern char *lmodelnames[NUM_LMODELS];
  62.  
  63. /*
  64.  *    And resetmodel() should be used to turn lighting back on after it
  65.  * has been turned off.
  66.  */
  67. void resetmodel(void);
  68.